{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "round-library",
   "metadata": {},
   "source": [
    "## 一、微积分编程（本大题20分）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "presidential-spider",
   "metadata": {},
   "source": [
    "1、编程解决如下问题：—个家禽养殖基地每天投入2元资金用于饲料、设备、人力，估计可使一只2千克重的鹅每天增加0.1千克。目前鹅出售市场价格为每千克30元，但是预测每天会降低0.04元。该基地应该什么时候出售这批鹅?如果上面的估计和预测有出入，那么对结果有多大影响?（20分）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "insured-creature",
   "metadata": {},
   "source": [
    "### 程序源代码："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "parallel-appearance",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最佳销售天数:第30天\n",
      "这天鹅的体重: 5.00 千克\n",
      "销售收入: 86.20元\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAEWCAYAAAB7QRxFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAtyklEQVR4nO3deZgU1b3/8fd3FphhG7ZhRxYlICiLArIoikRxIch1vQF/wSWiF1Fi4q5XjTeJxKhXjUSuUaNRIiAoSEziAmIEjAqCIJtbFIZ1AAGRAWY5vz9OzdAz0z3Ts08Nn9fz9DNdVaerTlX1fPr0qeoqc84hIiLhlVDTFRARkYpRkIuIhJyCXEQk5BTkIiIhpyAXEQk5BbmISMgpyCVuZrbfzLrGWdaZ2XFVXad4mNkVZra4pushxZnZaWa2oabrEXYK8goys/80sw/M7Hsz2xE8n2hmVgvq1jYI1NYR4+6KMe4fpc3POdfIOfdVJdSr1gSrmXUOtsf+4PG1md1e0/WqTObdYmafm1mWmW00sylmVr8alj0uYttmmVlex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x+xePHigtZ5jx496NSpE5999lnM8YMHD+bXv/41GRkZXHjhhXTr1o0FCxawfPlyBgzw993NysqiVatWxZY9dOjQgiAfPHgwAwcO5P7772fFihV0796dlJQU3n77bdauXVvwmn379vHdd98Vms/777/P3LlzARg7diw333xzwbSBAwfSoYP/Wte3b1++/vprTj311ErbfiLVZtWskgPy0HexDza+FdEibtwOWnaDeo3g8P7iy0nrCMNuOTI84t7CHw5Qciu796WVHtxF1aogL6nlDDB0ykI278kqNr5901RmXju4XMvs1asXc+bMKRieOnUqO3fupH///oDvQ48m1vixY8dyyimn8PrrrzNy5EiefvppnHOMHz+eBx54oMS6DBkyhN///vfk5uZyzTXX0LhxYw4ePMiiRYsK+sfz8vJ4//33SU1NLXFesdSvX7/geWJiIjk5OeWaj0iNitbSnjcRPpkBLg92fgb7SulyvWYhtOgGKU2izxOiB3Q1tbLLIlR95LeM7E5qcmKhcanJidwysnu553nmmWdy8OBBnnzyyYJxkQf9hg0bxvTp0wH47LPP2LhxI927d485/quvvqJr167ceOONjB49mlWrVjFixAhmz55dcOBy9+7dfPNN8atS9uzZky1btvDee+/Rr18/wLeap02bxpAhQwA4++yzeeKJJwpes3LlymLzGTRoUMGH04wZM+LaDo0bNy7WshepdrH6s/PyYM9G+PwtWPoEzP9ZlAOO2fDlQji4BzqfCmf+NzRoEX05aR2h/clHQhx8EP/ocT8N839/9Hj0gO59Kdz0Kdy3x/+twRCHWtYiL82Yfu0B+N0bG9iyJ4t2TVO5ZWT3gvHlYWbMnTuXm266iQcffJD09HQaNmzIb3/7WwAmTpzIddddx4knnkhSUhLPPfcc9evXjzl+5syZvPjiiyQnJ9OmTRvuuecemjdvzq9+9SvOPvts8vLySE5OZurUqXTq1KlYXU455RT27t1bcG2TwYMH89RTTxUE+eOPP871119P7969ycnJYdiwYcX6wR999FEuv/xyHn74Yc4//3zS0tJK3Q4TJkzg3HPPpW3btgUHbkUqTWndIPllirayX73Ov+7ALsiO86yqCYuOPG96TK3rBqkK1XrPzv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xEJOQW5iEjI/X/x54te19wekgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 初始条件\n",
    "goose_weight = 2  # 鹅的初始体重(千克)  \n",
    "cost_per_day = 2  # 每天的饲料和运营成本(元)\n",
    "weight_gain_per_day = 0.1  # 每天鹅体重增加量(千克)\n",
    "initial_price_per_kg = 30  # 初始鹅肉价格(元/千克)  \n",
    "price_drop_per_day = 0.04  # 每天鹅肉价格下降量(元/千克)\n",
    "\n",
    "# 存储结果\n",
    "days = []\n",
    "goose_weights = []  \n",
    "revenues = []\n",
    "\n",
    "# 养殖模拟\n",
    "num_days = 30  \n",
    "for day in range(num_days):\n",
    "    goose_weight += weight_gain_per_day  \n",
    "    price_per_kg = initial_price_per_kg - day * price_drop_per_day\n",
    "    revenue = goose_weight * price_per_kg - day * cost_per_day\n",
    "\n",
    "    days.append(day)\n",
    "    goose_weights.append(goose_weight)\n",
    "    revenues.append(revenue)\n",
    "\n",
    "# 找到最大收入点\n",
    "best_day = np.argmax(revenues)  \n",
    "print(f'最佳销售天数:第{best_day+1}天')\n",
    "print(f'这天鹅的体重: {goose_weights[best_day]:.2f} 千克')\n",
    "print(f'销售收入: {revenues[best_day]:.2f}元')\n",
    "\n",
    "# 画图  \n",
    "plt.plot(days, goose_weights, '-o', label='Goose Weight')\n",
    "plt.plot(days, revenues, '-o', label='Revenue')\n",
    "plt.xlabel('Day')\n",
    "plt.legend()\n",
    "plt.title('Goose Weight and Revenue Over Time')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "advised-welcome",
   "metadata": {},
   "source": [
    "### 结果分析："
   ]
  },
  {
   "cell_type": "markdown",
   "id": "expired-latex",
   "metadata": {},
   "source": [
    "这段代码模拟了养殖鹅的过程，并分析了鹅的体重和每日收入随时间的变化。\n",
    "\n",
    "1. **鹅体重变化**：\n",
    "   - 随着时间的推移，鹅的体重逐渐增加，这是符合预期的，因为每天鹅体重增加了0.1千克。\n",
    "\n",
    "2. **收入变化**：\n",
    "   - 每天的销售收入受到鹅的体重和鹅肉价格的影响。收入曲线呈现出一种先增加后减少的趋势。\n",
    "   - 随着时间推移，鹅肉价格每天下降0.04元/千克，导致收入逐渐减少。\n",
    "\n",
    "3. **最佳销售天数**：\n",
    "   - 通过模拟计算，找到了最佳销售天数，即能够获得最大收入的时间点。\n",
    "   - 该时间点对应的鹅的体重和相应的销售收入。\n",
    "\n",
    "4. **分析结果**：\n",
    "   - 该模拟显示了养殖鹅的收入随时间变化的情况，对于决策者来说，能够找到最佳销售时间点是关键，这能帮助决定何时出售鹅以获得最大收入。\n",
    "\n",
    "通过分析模拟的结果，可以更好地了解鹅养殖的效益随时间的变化情况，帮助制定更明智的销售策略。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c5e82fc7-f9fc-4941-a867-ea8a6d63ab07",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
